//这个主要是用来 做主页的网络请求的
import { require } from 'network/index';

//这是请求首页滚动条的
export function detailrequires(iid) {

    return require({
        url: "api/wh/detail",
        params: {
            iid
        }
    });
}

//这是请求推荐数据的
export function recommand() {

    return require({
        url: "/api/wh/recommend",
        
    });
}


//因为请求的数据太杂乱，所以包装一个类对商品信息进行统一的管理
export class Goods {
    constructor(itemInfo, columns, services) {
        this.title = itemInfo.title;
        this.desc = itemInfo.desc;
        this.newPrice = itemInfo.price;
        this.oldPrice = itemInfo.oldPrice;
        this.discount = itemInfo.discountDesc;
        this.columns = columns;
        this.services = services;
        this.realPrice = itemInfo.lowNowPrice;
    }



}
//因为请求的数据太杂乱，所以包装一个类对商家信息进行统一的管理
export class Shop {
    constructor(shopInfo) {
        this.logo = shopInfo.shopLogo;
        this.name = shopInfo.name;
        this.fans = shopInfo.cFans;
        this.sells = shopInfo.cSells;
        this.score = shopInfo.score;
        this.goodsCount = shopInfo.cGoods
    }
}
